/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.*;

/**
 * @author Gerrit
 */
public class game extends MIDlet {
    private marioCanvas gameCanvas;
    private Thread t;
    private Display d;

  public void startApp() {
      if (gameCanvas == null) {
            this.gameCanvas = new marioCanvas();
            this.t = new Thread(gameCanvas);
            t.start();
            d = Display.getDisplay(this);
            d.setCurrent(gameCanvas);
      } else {
          gameCanvas.startMusic();
      }
  }
  
  public void pauseApp() {
    this.gameCanvas.stopMusic();
  }

  public void destroyApp(boolean unconditional) {
     this.gameCanvas.closeMusic();
     this.gameCanvas = null;
  }

  

}
